import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView,
		redirect:"/homepage",
		children:[
			{
				path: 'homepage',
				component: () => import('../views/HomePage.vue')
			},
			{
				path: 'usermanager',
				component: () => import('../views/UserManager.vue'),
				redirect:"/usermanager/usermanagement",
				children:[
					{
						
						path: 'usermanagement',
						component: () => import('../views/UserManagement.vue'),
					},
					{
						
						path: 'userrole',
						component: () => import('../views/UserRole.vue'),
					},
					
				
				]
			},
			{
				path: 'menumanager',
				component: () => import('../views/MenuManager.vue'),
				redirect:"/menumanager/menumanagefirst",
				children:[
					{
						path:"menumanagefirst",
						component:()=>import('../views/MenuManageFirst.vue')
					},
					{
						path:"addnewmenu",
						component:()=>import("../views/AddnewMenu")
					}
				]
			},
			{
				path: 'approvalmanager',
				name:'approvalmanager',
				component: () => import('../views/ApprovalManager.vue'),
				redirect:"/approvalmanager/ApproveYuangong",
				children:[
					{
						name:"ApproveYuangong",
						path: '/approvalmanager/ApproveYuangong',
						component: () => import('../views/ApproveYuangong.vue'),
					},
					{
						name:"ApproveHuanke",
						path: '/approvalmanager/ApproveHuanke',
						component: () => import('../views/ApproveHuanke.vue'),
					},
					{
						name:"Aprovetiaoke",
						path: '/approvalmanager/Aprovetiaoke',
						component: () => import('../views/Aprovetiaoke.vue'),
					},
				]
			},
			{
				path: 'coursemanager',
				component: () => import('../views/CourseManager.vue'),
				redirect:"/coursemanager/coursemanagement",
				children:[
					{
						path: 'coursemanagement',
						component: () => import('../views/CourseManagement.vue'),
						redirect:"/coursemanager/coursemanagement/courses",
						children:[
							{
								path: 'courses',
								component: () => import('../views/Courses.vue'),
							},
							{
								path: 'courdetail',
								component: () => import('../views/CourDetail.vue')
							},
							{
								path: 'courseclass',
								component: () => import('../views/Courseclass.vue'),
								
							},
							{
								path:'changeclasstable',
								component:()=>import('../views/ChangeClassTable.vue')
							},
							{
								path:'addclasstable',
								component:()=>import('../views/Addclasstable.vue')
							}
							
						]
					},
					{
						path: 'adjustcourse',
						component: () => import('../views/Adjustcourse.vue'),
						redirect:"/coursemanager/adjustcourse/adjustcourses",
						children:[
							{
								path: 'adjustcourses',
								component: () => import('../views/Adjustcourses.vue')
							},
							{
								path: 'addadjustcourse',
								component: () => import('../views/Addadjustcourse.vue')
							},
							{
								path: 'adjustcoursedetail',
								component: () => import('../views/Adjustcoursedetail.vue')
							},
						]
					},
					{
						path: 'changecourse',
						component: () => import('../views/Changecourse.vue'),
						redirect:"/coursemanager/changecourse/changecourses",
						children:[
							{
								path: 'changecourses',
								component: () => import('../views/Changecourses.vue')
							},
							{
								path: 'changecoursesdetail',
								component: () => import('../views/Changecoursesdetail.vue')
							},
							{
								path: 'addchangecourses',
								component: () => import('../views/Addchangecourses.vue')
							},
							
							
						]
					},
				]
			},
			{
				path: 'leavemanager',
				component: () => import('../views/LeaveManager.vue'),
				redirect:"/leavemanager/host",
				children:[
					{
						path:'host',
						component: () => import('../views/Host.vue')
					},
					{
						path:'applfor',
						component: () => import('../views/Applfor.vue')
					},
					{
						path:'details',
						component: () => import('../views/Details.vue')
					}
				]
			},
			{
				path: 'classmanager',
				component: () => import('../views/ClassManager.vue'),
				redirect:'/classmanager/classmanagerchildren',
				children:[
					{
						path:'classmanagerchildren',
						component:()=>import('../views/ClassManagerChildren.vue')
					},
					{
						path:'classdetails',
						component:()=>import('../views/ClassDetails.vue'),
						redirect:"/classmanager/classdetails/studentinformation",
						children:[
							{
								path:'studentinformation',
								component:()=>import('../views/StudentInformation.vue'),
							},
							{
								path:'courseinformation',
								component:()=>import('../views/CourseInformation.vue'),
								redirect:'/classmanager/classdetails/courseinformation/timetable',
								children:[
									{
										path:'timetable',
										component:()=>import('../views/Timetable.vue')
									},
									{
										path:'classcourses',
										component:()=>import('../views/ClassCourses.vue')
									},
								]
							},
							{
								path:'updatecourse',
								component:()=>import('../views/UpdateCourse.vue')
							},
							{
								path:'addstudent',
								component:()=>import('../views/AddStudent.vue')
							},
							{
								path:'studentdetails',
								component:()=>import('../views/StudentDetails.vue')
							}
						]
					},
				]
			},
			{
				path: 'teachermanager',
				component: () => import('../views/TeacherManager.vue'),
				redirect:"/teachermanager/teachermanager2",
				children:[
					{
						path:"teachermanager2",
						component:()=>import('../views/TeacherManager2.vue')
					},
					{
						path:"teacherdetails",
						component:()=>import("../views/Teacherdetails")
					},
					{
						path:"addnewteacher",
						component:()=>import("../views/AddnewTeacher")
					}
				]
			},
			{
				path: 'studentmanager',
				component: () => import('../views/StudentManager.vue'),
				redirect:"/studentmanager/student",
				children:[
					{
						path:'student',
						component: () => import('../views/Student.vue'),
					},
					{
						path:'addstudent1',
						component: () => import('../views/AddStudent1.vue'),
					},
					{
						path:'morestudent',
						component: () => import('../views/MoreStudent.vue'),
					},
				]
			},
		]
  },
  {
    path: '/login',
    name: 'login',
   
    component: () => import('../views/Login.vue')
  }
]

const router = new VueRouter({
	mode:"hash",
  routes
})

export default router
